﻿<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="apple-mobile-web-app-title" content="思路广惠">
		<title>积分显示</title> 
		<meta content="telephone=no" name="format-detection" /> 
		<link rel="stylesheet" type="text/css" href="../../src/css/base.css?1.0" /> 
	</head>

	<body class="body-bg">
		<header class="header">
			<a href="javascript: history.go(-1)" class="head-le"><i class="iconfont icon-fanhui i2m"></i></a>
			<h1 class="header-txt"> </h1>
			<!--<div class="head-ri">明细</div>-->
		</header>
		<section>
			
		</section>
		<script type="text/html" class="pointsum">

			<div class="centre balance"> 
				<img style="height: 1.3rem;" src="../../src/images/icon-money31x35.png" /> <span class="s13m">账户余额</span> 
				<p id="allPoint" class="huef36 top1rem s13m"> </p>
			</div>
			
			<div class="own-save"> 
	            <a class="own-save-btn" href="pointdeal.html?flag=1"> 
					充值
				</a>
			</div>
			

		</script>
		<script type="text/html" class="pointsum">
 
			<header class="drawal centre">
				<p class="s12m">总资产(元)</p>
				<div class="s13m top1rem" id="allCash"> </div>
				 <img style="height: 1rem;" src="../../src/images/icon-prompt-cash.png" /> 提现时，请输入整数提取 
			</header>
			 
			<h1 class="pad1rem s13m col3">提现记录</h1>
			<ul id="getCashs">
				
			</ul>
			 

			<footer class="setup-foo">
					<a href="pointdeal.html?flag=0">我要提现</a>
			</footer> 
		</script>
		<script type="text/html" id="getCash">
			{{# if(d.length == 0){ }}
			<div class="centre">
				 <img src="../../src/images/null-jifentixianjiluweikong.png" />  
				<p class="top1rem s13m">暂无提现记录</p>
			</div>
			{{# }else{ }}
			<ul>
				{{# for(var i = 0; i < d.length; i ++){ }} <li>
					<li class="btm1rem bg-fff" data-type="{{d[i].Draw_ID}}">
						<div class="flexs-bw flexs-al setup-btm pad1rem">
							<span>提现单号: {{d[i].Draw_OrderNumber}}</span>
							<button class="cashCancel" type="button" >取消</button>
						</div>
						<div class="pad1rem">
							<p class="col3 s13m">提现金额: <span class="huef36">{{d[i].Draw_Money}} 元</span> </p>
							<p class="flexs-bw top1rem"> 
								<span>订单时间：{{d[i].Draw_ApplyTime}}</span>
								<strong class="uplist-span">{{d[i].Draw_Mark}}</strong>
							</p>
						</div>
						
					</li> 
					 
					{{# } }}
			 <div class="centre promLe-foo pad-ud">已全部展示</div>
			{{# } }}
		</script>
		<script src="http://apps.bdimg.com/libs/laytpl.js/1.1/laytpl.js"></script>
		<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
		<script src="//cdn.bootcss.com/layer/3.0.1/mobile/layer.js"></script>
		<script src="../../src/js/all.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var numhref = silks.getByVal("flag");

			$.get(urls + "/WorkMembers/GetMembersInfo", {
				MembersID: MembersID,
				AppID: AppID,
				Token: Token
			}, function(res) {
				if(res.Return_ID == 0) {
					var res = res.Return_Data;
					switch(numhref) {
						case "0":
							$("section").prepend($(".pointsum:last").html());
							$("#allCash").html(res.Members_CashCoin);
							$(".header-txt").html("积分提现");
							$.get(urls + "/WorkMembersDraw/GetMembersDrawByID", {
								MembersID: MembersID,
								OrderNumber: "",
								PageIndex: 1,
								AppID: AppID,
								Token: Token,
								StartDate: "",
								EndDate: ""

							}, function(res) {
								console.log(res)
								if(res.Return_ID == 0) {
									laytpl($("#getCash").html()).render(res.Return_Data.PageData, function(html) {
										$("#getCashs").html(html);
										// 取消提现申请
										
										$(".cashCancel").click(function() {
											$.get(urls + "/WorkMembersDraw/GetMembersDrawByID", {
												MembersID: MembersID,
												DrawID: $(this).closest(".order-items").attr("data-type"),
												AppID: AppID,
												Token: Token
											}, function(res) {
												layers(res.Return_Mess);
											});
										});
										
									});
								} 
							});

							break;
						case "1":
							$("section").prepend($(".pointsum:first").html());
							$("#allPoint").html(res.Members_Points);
							$(".header-txt").html("余额");
							$("header").append('<a class="head-ri" href="pointwater.html?flag=true">明细</a>');
							break;
						default:
							//没有其他条件
							break;
					}
				}
			});
		</script>
	</body>

</html>